aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/invoice/[amount].js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2022-07-29 23:40:59 -0700
committerAdam Soltys <[email protected]>2022-07-29 23:40:59 -0700
commit375b660848e60e8f25c8e49dcf63480aa86cd541 (patch)
treebc7aa1c384984829f810776bc371596a294b38db /src/routes/invoice/[amount].js
parent9414eb90e4dba3c69db76f2cfafb60515a5b3a90 (diff)
downloadcoinos-ui-375b660848e60e8f25c8e49dcf63480aa86cd541.tar.gz
coinos-ui-375b660848e60e8f25c8e49dcf63480aa86cd541.zip
dynamic qr lib import and invoice amount param
Diffstat (limited to 'src/routes/invoice/[amount].js')
-rw-r--r--src/routes/invoice/[amount].js14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/routes/invoice/[amount].js b/src/routes/invoice/[amount].js
new file mode 100644
index 00000000..f75a1672
--- /dev/null
+++ b/src/routes/invoice/[amount].js
@@ -0,0 +1,14 @@
+import { post } from '$lib/utils';
+
+const username = 'bob',
+ network = 'lightning';
+
+export async function GET({ params }) {
+ let { amount } = params;
+ console.log("AMT", amount);
+ let { text } = await post('/lightning/invoice', { amount });
+ console.log("TXT", text);
+ await post('/invoice', { invoice: { text, network }, user: { username } });
+
+ return { body: { amount, text } };
+}